package web.dmt.dao.proxy;
import web.dmt.dao.*;
import web.dmt.dao.impl.Iimpl;
import web.dmt.dbc.*;
import web.dmt.vo.Myuser;
public class Iproxy implements IDAO{
private DatebaseConnection dbc;
private Iimpl dao;
public Iproxy(){
	this.dbc=new DatebaseConnection();
	this.dao=new Iimpl(this.dbc.getConnection());
}
public boolean findLogin(Myuser users)throws Exception{
	boolean flag=false;
	try{
		flag=this.dao.findLogin(users);
	}catch(Exception e){
		throw e;
	}finally{
		this.dbc.close();
	}
	return flag;
}
public Myuser findLogin(String uemail, String upassword) throws Exception {
	Myuser user=null;
	try{
		user=this.dao.findLogin(uemail,upassword);
	}catch(Exception e){
		throw e;
	}finally{
		this.dbc.close();
	}
	return user;
}
public boolean doGreate(Myuser users)throws Exception{
   boolean flag=false;
   try{
	   flag=this.dao.doGreate(users);
   }catch(Exception e){
		throw e;
   }finally{
	   this.dbc.close();
   }
	return flag;
}

public boolean doUpdate(Myuser user) throws Exception {
	boolean flag=false;
	try{
		flag=this.dao.doUpdate(user);
	}catch(Exception e){
		throw e;
	}finally{
		this.dbc.close();
	}
	return flag;
}
public Myuser findById(int uid) throws Exception {
	Myuser user=null;
	try{
		user=this.dao.findById(uid);
	}catch(Exception e){
		throw e;
	}finally{
		this.dbc.close();
	}
	return user;
}

}
